package 剑指Offer.easy;

public class 不用加减乘除做加法 {
    class Solution {
        public int add(int a, int b) {
            while (b != 0) {
                int c = (a & b) << 1;//计算进位
                a = a ^ b;//计算无进位和
                b = c;
            }
            return a;
        }
    }
}
